package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CgGestion generated by hbm2java
 */
@Entity
@Table(name = "CG_GESTION", schema = "UPET")
public class CgGestion implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4500225598731730578L;
	private String cgestion;
	private String dgestion;
	private String munidadTiempo;
	private String cusuario;
	private Date fhingreso;
	private Date fhmodificacion;
	private Set<CgEtapa> cgEtapas = new HashSet<CgEtapa>(0);
	private Set<CgActividad> cgActividads = new HashSet<CgActividad>(0);

	public CgGestion() {
	}

	public CgGestion(String cgestion, String dgestion, String cusuario,
			Date fhingreso, Date fhmodificacion) {
		this.cgestion = cgestion;
		this.dgestion = dgestion;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
	}

	public CgGestion(String cgestion, String dgestion, String munidadTiempo,
			String cusuario, Date fhingreso, Date fhmodificacion,
			Set<CgEtapa> cgEtapas, Set<CgActividad> cgActividads) {
		this.cgestion = cgestion;
		this.dgestion = dgestion;
		this.munidadTiempo = munidadTiempo;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
		this.cgEtapas = cgEtapas;
		this.cgActividads = cgActividads;
	}

	@Id
	@Column(name = "C_GESTION", unique = true, nullable = false, length = 2)
	public String getCgestion() {
		return this.cgestion;
	}

	public void setCgestion(String cgestion) {
		this.cgestion = cgestion;
	}

	@Column(name = "D_GESTION", nullable = false, length = 40)
	public String getDgestion() {
		return this.dgestion;
	}

	public void setDgestion(String dgestion) {
		this.dgestion = dgestion;
	}

	@Column(name = "M_UNIDAD_TIEMPO", length = 1)
	public String getMunidadTiempo() {
		return this.munidadTiempo;
	}

	public void setMunidadTiempo(String munidadTiempo) {
		this.munidadTiempo = munidadTiempo;
	}

	@Column(name = "C_USUARIO", nullable = false, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", nullable = false, length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_MODIFICACION", nullable = false, length = 7)
	public Date getFhmodificacion() {
		return this.fhmodificacion;
	}

	public void setFhmodificacion(Date fhmodificacion) {
		this.fhmodificacion = fhmodificacion;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cgGestion")
	public Set<CgEtapa> getCgEtapas() {
		return this.cgEtapas;
	}

	public void setCgEtapas(Set<CgEtapa> cgEtapas) {
		this.cgEtapas = cgEtapas;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cgGestion")
	public Set<CgActividad> getCgActividads() {
		return this.cgActividads;
	}

	public void setCgActividads(Set<CgActividad> cgActividads) {
		this.cgActividads = cgActividads;
	}

}
